/**
 * MineAdmin is committed to providing solutions for quickly building web applications
 * Please view the LICENSE file that was distributed with this source code,
 * For the full copyright and license information.
 * Thank you very much for using MineAdmin.
 *
 * @Author X.Mo<root@imoi.cn>
 * @Link   https://github.com/mineadmin
 */
const props1 = {
  checkStrictly: true,
}
const options = [
  {
    value: 'guide',
    label: 'Guide',
    children: [
      {
        value: 'disciplines',
        label: 'Disciplines',
        children: [
          {
            value: 'consistency',
            label: 'Consistency',
          },
        ],
      },
      {
        value: 'navigation',
        label: 'Navigation',
        children: [
          {
            value: 'side nav',
            label: 'Side Navigation',
          },
          {
            value: 'top nav',
            label: 'Top Navigation',
          },
        ],
      },
    ],
  },
  {
    value: 'component',
    label: 'Component',
    children: [
      {
        value: 'basic',
        label: 'Basic',
        children: [
          {
            value: 'layout',
            label: 'Layout',
          },
        ],
      },
    ],
  },
  {
    value: 'resource',
    label: 'Resource',
    children: [
      {
        value: 'axure',
        label: 'Axure Components',
      }
    ],
  },
]
import type { MaSearchItem } from '@mineadmin/search'
import MaDictSelect from '@/components/ma-dict-picker/ma-dict-select.vue'

export default function getSearchItems(t: any): MaSearchItem[] {
  return [
    {
      prop: 'username',
      render: ({ formData }) => (
        console.log(formData, 'row'),
        <el-input placeholder="名称，id支持逗号分隔"
          v-slots={{
            // 前置插槽
            prepend: () => (
              <el-select
                modelValue={formData.type}
                onUpdate:modelValue={(val) => (formData.type = val)}
                style={{ width: '120px' }}
              >
                <el-option label="商品ID" value="account" />
                <el-option label="商品名称" value="phone" />
              </el-select>
            ),
          }}
        />
      )
    },
    {
      label: '商品分类',
       prop: 'xxxx',
       render:'cascader',
       renderProps: { 
        props: props1,
        options: options
      },
    },
    {
      label: '渠道',
      prop: 'phone',
      render: ({ formData }) => (
        <el-select
        v-model={formData.phone}

        >
          <el-option label="测试1" value="account" />
          <el-option label="测试2" value="phone" />
        </el-select>
      ),
    },
    {
      label: '渠道商品ID',
      prop: 'email',
      render: 'input',
    },

    {
      label: '商品类型',
       prop: 'sptype',
       render: ({ formData }) => (
        <el-select
        v-model={formData.sptype}
        >
          <el-option label="测试1" value="account" />
          <el-option label="测试2" value="phone" />
        </el-select>
      ),
    },
    {
      label: '商品状态',
       prop: 'sptype',
       render: ({ formData }) => (
        <el-select
        v-model={formData.sptype}
        >
          <el-option label="测试1" value="account" />
          <el-option label="测试2" value="phone" />
        </el-select>
      ),
    },
    {
      label: '所属供货商',
       prop: 'xxxx',
       render:'input',
    },
    {
      label: '来源类型',
       prop: 'xxxx',
       render: ({ formData }) => (
        <el-select
        v-model={formData.sptype}
        >
          <el-option label="测试1" value="account" />
          <el-option label="测试2" value="phone" />
        </el-select>
      ),
    }
  ]
}
